#ifndef CONFIG_H
#define CONFIG_H

#include <string>
#include <map>

// Configuration structure
struct BaseConfig {
    // Serial port configuration
    std::string port;
    int baudRate;
    int stopBits;
    int dataBits;
    std::string parity;
    std::string flowControl;
    
    // Radio configuration
    std::string currentBand;     // 160, 80, 40, 30, 20, 15, 12, 10
    double currentFrequency;     // Frequency in MHz
    int wpm;                     // Words per minute (5-40)
};

// Global configuration variable
extern BaseConfig baseConfig;

// Global variables for function key configuration
extern std::map<std::string, std::map<std::string, std::string>> config;

// Function declarations
std::string trim(const std::string& str);
bool loadBaseConfig(const std::string& configFile);
bool saveBaseConfig(const std::string& configFile);
std::map<std::string, std::string> parseConfigFile(const std::string& configFile);

#endif // CONFIG_H